﻿<ui:DialogWindowVersioningWorkaround
    x:Class="Microsoft.NodejsTools.Project.ImportWizard.ImportWizard"
    x:ClassModifier="internal"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:l="clr-namespace:Microsoft.NodejsTools.Project.ImportWizard"
      xmlns:wpf="clr-namespace:Microsoft.VisualStudioTools.Wpf"
    xmlns:pt="clr-namespace:Microsoft.NodejsTools"
    xmlns:ui="clr-namespace:Microsoft.VisualStudioTools"
    Height="525" Width="700"
    MinHeight="500" MinWidth="500"
    ResizeMode="CanResizeWithGrip"
    HasMaximizeButton="True"
    UseLayoutRounding="True"
    SnapsToDevicePixels="True"
    WindowStartupLocation="CenterOwner">

    <Window.Title>
        Create New Project from Existing Node.js Code
    </Window.Title>
    
    <Window.Resources>
        <ResourceDictionary Source="ImportWizardDictionary.xaml" />
    </Window.Resources>

    <Window.CommandBindings>
        <CommandBinding Command="{x:Static wpf:Commands.BrowseFolder}" CanExecute="Browse_CanExecute" Executed="Browse_Executed" />
        <CommandBinding Command="{x:Static wpf:Commands.BrowseOpenFile}" CanExecute="Browse_CanExecute" Executed="Browse_Executed" />
        <CommandBinding Command="{x:Static wpf:Commands.BrowseSaveFile}" CanExecute="Browse_CanExecute" Executed="Browse_Executed" />
        
        <CommandBinding Command="ApplicationCommands.Save" CanExecute="Finish_CanExecute" Executed="Finish_Executed" />
        <CommandBinding Command="ApplicationCommands.Close" CanExecute="Cancel_CanExecute" Executed="Cancel_Executed" />
        <CommandBinding Command="NavigationCommands.BrowseBack" CanExecute="Back_CanExecute" Executed="Back_Executed" />
        <CommandBinding Command="NavigationCommands.BrowseForward" CanExecute="Next_CanExecute" Executed="Next_Executed" />
    </Window.CommandBindings>

    <Grid Background="{DynamicResource {x:Static wpf:Controls.BackgroundKey}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <Grid Grid.Column="0" Grid.RowSpan="3"
              Background="{DynamicResource {x:Static wpf:Controls.BackgroundAccentKey}}">
            <Image Source="/Microsoft.NodejsTools;component/Resources/Icons/NewProjectDialogIconsICO/NodeJSApplication.ico"
                   Stretch="Uniform"
                   MaxWidth="64px"
                   Margin="24px"
                   HorizontalAlignment="Center" VerticalAlignment="Top" />
        </Grid>
        
        <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Title}" Margin="8">
            Welcome to the Create New Project from Existing Node.js Code Wizard
        </TextBlock>
        
        <Frame Grid.Row="1" Grid.Column="1"
               Content="{Binding PageSequence.CurrentItem}"
               NavigationUIVisibility="Hidden"
               Focusable="False" IsTabStop="False"
               Margin="8" />
        
        <StackPanel Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Margin="8" Grid.IsSharedSizeScope="True">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition SharedSizeGroup="A" Width="auto" />
                    <ColumnDefinition SharedSizeGroup="A" Width="auto" />
                    <ColumnDefinition SharedSizeGroup="A" Width="auto" />
                    <ColumnDefinition SharedSizeGroup="A" Width="auto" />
                </Grid.ColumnDefinitions>
                <Grid.Resources>
                    <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
                        <Setter Property="HorizontalAlignment" Value="Stretch" />
                    </Style>
                </Grid.Resources>
                <Button Grid.Column="0" Command="NavigationCommands.BrowseBack">_Back</Button>
                <Button Grid.Column="1" Command="NavigationCommands.BrowseForward" IsDefault="{Binding IsNextDefault}">_Next</Button>
                <Button Grid.Column="2" Command="ApplicationCommands.Save" IsDefault="{Binding IsFinishDefault}">_Finish</Button>
                <Button Grid.Column="3" Command="ApplicationCommands.Close">_Cancel</Button>
            </Grid>
        </StackPanel>
    </Grid>
</ui:DialogWindowVersioningWorkaround>
